package com.kedacom.freedomLabel.model.bean;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Ignore;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

import com.kedacom.freedomLabel.excel.IRowRecord;
import com.kedacom.freedomLabel.utils.Utils;

/**
 * @author licheng
 * @since 2019/10/25 13:52
 */
@Entity
public class Business implements IRowRecord {

    // 索引
    @PrimaryKey(autoGenerate = true)
    public int index;

    // 产品名称
    public String name;

    // 产品标识
    public String product_id;

    // 产品编号
    public String productNumber;

    // 操作员
    public String cardNumber;
    public String operator_name;

    // 类别
    public String category;

    // 是否自动删除
    public boolean isAutoDelete;

    // 净重
    public String netWeight;

    // 称重单位
    public String weightUnit;

    // 毛重
    public String grossWeight;

    // 数量
    public int count;

    //上限
    public String upper;

    //下限
    public String low;

    // 创建时间
    public Long createTime;

    // 偏离上下限 100 没有计算 -1 低于下限 0 ok 1 高于上限
    public int weightStatus = 100;

    public String itemUUID1;
    public String itemValue1;

    public String itemUUID2;
    public String itemValue2;

    public String itemUUID3;
    public String itemValue3;

    public String itemUUID4;
    public String itemValue4;

    public String itemUUID5;
    public String itemValue5;

    public String itemUUID6;
    public String itemValue6;

    @Ignore
    public boolean selected = false; // 是否被选中

    @NonNull
    @Override
    public String[] rowValues() {
        return new String[]{productNumber, name, netWeight, grossWeight ,weightUnit, String.valueOf(count), upper + "g", low + "g", Utils.millToString(createTime), operator_name, cardNumber, itemValue1, itemValue2, itemValue3, itemValue4, itemValue5, itemValue6};
    }

    @Override
    public boolean[] isNumber() {
        return new boolean[]{false,false,true,true,false,true,false,false,false,false,false,false,false,false,false,false,false};
    }
}